home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / exechk.arc / EXECHK.DOC < prev    next >
Text File  |  1990-12-06  |  4KB  |  90 lines

  1. (*******************************************************************
  2. [76576,470]
  3. EXECHK.ZIP/binary             6-Dec-90 xxxx               Accesses: xx
  4.  
  5.     Title   : Copy discouragement
  6.     Keywords: APPLICATION COPY EXE FILE ILLEGAL PROTECT SOFTWARE SOURCE STAMP
  7.  
  8. Source code illustrates a method of "stamping" your original
  9. application EXE file with the user's name, address, serial #,
  10. etc., in order to discourage illegal copying of your software.
  11. This method works with files compressed using LZEXE and will
  12. compile under any version of TP.  Includes sample application
  13. and installation programs.
  14. *******************************************************************)
  15.  
  16. (*******************************************************************
  17. PURPOSE
  18. -------
  19. To discourage illegal copying of software, by "stamping" the user's
  20. Name, Serial#, etc. onto the EXE file itself.  (Actually it is appended
  21. to the end of the EXE file.)
  22.  
  23. DIRECTIONS FOR USE
  24. ------------------
  25. After compiling both files (MYPROG.PAS and MYINSTAL.PAS), try to
  26. run them.  MYPROG.EXE will not run until it has been modified by
  27. MYINSTAL.EXE, and the MYINSTAL.EXE will only run from the A: drive.
  28.  
  29. Copy both EXE files to a diskette in A: drive, then run "a:myinstal".
  30. You will be prompted for your name, company, city/state and software
  31. serial number, which will be written to the MYPROG.EXE file on the
  32. A: drive.  Now the MYPROG.EXE will run (from any drive), displaying
  33. the user/licensee data on startup.
  34.  
  35. WARNING!
  36. --------
  37. You must reset the "FileMode" variable to ReadWrite, as the EXECHK
  38. routine sets the "FileMode" variable to ReadOnly under DOS 2.x and
  39. to Read_DenyNone under DOS 3.x.  If you encounter a failure in your
  40. programs when writing to a file, then this is most likely the cause.
  41.  
  42. This is done for you in the demo programs.
  43.  
  44. NOTES
  45. -----
  46. Checks the EXE file header (see the "exechk.def" file) and compares
  47. it to the actual "FileSize", during program initialization.
  48. Will work correctly even if the EXE file has been LZEXE'd.
  49.  
  50. The "ExeInstallData" and "ExeReadData" routines are not specific
  51. to the data types used in "mydata.inc"; they use a VAR parameter so
  52. you can create your own.  You do have to specify the size of the
  53. variables which you're using, however.
  54.  
  55. If you had just a one line "stamp" string, you would call either
  56. routine like this:
  57.  
  58. VAR
  59.    MyDataStruc               : string ;
  60. begin
  61.    Exe....Data ( MyFileName , MyDataStruc , SizeOf ( MyDataStruc ) ) ;
  62. end .
  63.  
  64. Since the user-specific information is only appended the the EXE file,
  65. it could, of course, be altered by a savvy user through Norton Utils,
  66. PC-Tools, etc.  If this is a concern, you could add an encryption routine
  67. and cross-check the data structure, without having to rework the
  68. main routines.
  69.  
  70. PROGRAM LOGIC - The First "INSTALL"
  71. -----------------------------------
  72. If "IsExePersonalized" returns FALSE, get the user information
  73. ("MyDataInput") and call the "ExeInstallData" routine to append
  74. the information to the original EXE file, presumably on drive A:
  75.  
  76. PROGRAM LOGIC - Subsequent "INSTALLS"
  77. -------------------------------------
  78. Since the user may have to re-install the program (due to disk problems,
  79. purchase of a new machine, inadvertant format/erasure, etc.), if
  80. the "IsExePersonalized" returns TRUE, then skip the "MyDataInput"
  81. and go directly to your main installation.
  82.  
  83. PROGRAM LOGIC - The actual application software
  84. -----------------------------------------------
  85. If function "IsExePersonalized" returns FALSE, then the program should
  86. HALT, because it has not yet been "stamped".  Of course, it would be
  87. polite to inform the user that he must have the original disk and
  88. should install it properly.
  89. *******************************************************************)
  90.